package com.ascentive.finallyfast.deepclean;

import com.ascentive.finallyfast.FinallyFastApplication;

import android.text.ClipboardManager;
import android.widget.Toast;

public class ClipboardData extends DeepCleanListItem {

	int noOfBytesDeleted = 0;
	public ClipboardData(FinallyFastApplication app, String name, boolean value, int img) {
		super(app, name, value, img);

	}

	@Override
	void doClean() {
		
		String clip = mApp.getApplicationContext().CLIPBOARD_SERVICE;
		ClipboardManager clipboardManager = (ClipboardManager) mApp.getApplicationContext().getSystemService(clip);
		
		if (clipboardManager.hasText()) {
			noOfBytesDeleted = clipboardManager.getText().toString().length();
		}
		clipboardManager.setText("");
		return;
	}

	@Override
	int numberOfFileCleaned() {
		return noOfBytesDeleted;
	}
}
